extends layout

block title
    title 发帖

block extraStyles

block bodyContent

    .view.view-handle-topic

        h2 发帖

        - var submit = "return false"
        if r
            form(action="/create-topic", method=r._id ? "put" : "post", onsubmit=submit)
                input(type="hidden", name='_id', value=r._id)
                label 标题
                input(type='text', name='title', value=r.title)
                label 正文
                input(name='content', value=r.content)

                button.submit(type="submit") 提交
        else
            form(action="/topic/new", method="post", onsubmit=submit)
                label 标题
                input(type='text', name='title')
                label 正文
                input(name='content')

                button.submit(type="submit") 提交


block extraScripts
    script(src="/static/script/handle-topic.js")